#include "sys.h"

//
void CloseAllPeripheral(void)
{
    LED(0xFF);
    BUZ(0x00);
}


//11.0592MHz
void Delay10Ms(void)
{
	unsigned char i, j;

	i = 108;
	j = 145;
	do
	{
		while (--j);
	} while (--i);
}


//
static unsigned int ms[7];
bdata unsigned char flag = 0;


void IsrTimer2(void)    interrupt 12
{
	GetDisplayStruct()->SegDisplay();

	if(++ms[0] == 20){
		ms[0] = 0;
		flag |= 0x01;	//键盘20ms扫描一次
	}

	if(++ms[1] == 200){
		ms[1] = 0;
		flag |= 0x02;
	}

	if(++ms[2] == 200){
		ms[2] = 0;
		flag |= 0x04;
	}

	if(++ms[3] == 500){
		ms[3] = 0;
		flag |= 0x08;
	}

	if(++ms[4] == 1000){
		ms[4] = 0;
		flag |= 0x10;
	}

	if(++ms[5] == 200){
		ms[5] = 0;
		flag |= 0x20;
	}
}